package com.corticon.dialogs.dao.hibernate;

import java.util.List;

import org.springframework.stereotype.Repository;

import com.corticon.dialogs.dao.ResponseEntryDAO;
import com.corticon.dialogs.model.ResponseEntry;
import com.corticon.dialogs.model.ResponseType;

/**
 *
 * @author Lifan Yang
 */
@Repository("responseEntryDAO")
public class ResponseEntryHibernateDAO extends GenericHibernateDAO<ResponseEntry, Long> implements
    ResponseEntryDAO {

    @Override
    public List<ResponseEntry> findByResponseType(ResponseType type) {
        return getSession().createQuery("from ResponseEntry re where re.responseType = :type").
            setParameter("type", type).list();
    }
}